﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using estudent.ActionFilters;
using estudent.Models;

namespace estudent.Controllers
{
    public class PrijavaNaIzpitController : Controller
    {
        estudentEnt db = null;
        

        IEnumerable<decimal> letnik = null;
        IEnumerable<string> vrstaVpisa = null;
        IEnumerable<sPredmeti> predmeti = null;
        //
        // GET: /PrijavaNaIzpit/

        public ActionResult Index()
        {
            this.db = new estudentEnt();
            string prijavljeniStud = Session["Name"].ToString();

            letnik = from v in db.Vpisis
                     where v.username == prijavljeniStud
                     select v.idLetnikStudija;

            vrstaVpisa = from v in db.Vpisis
                         where v.username == prijavljeniStud
                         select v.idVrstaVpisa;

            predmeti = from v in db.Vpisis
                       from d in v.sPredmetis
                       where v.username == prijavljeniStud
                       select d;
            

            return View();
        }

    }
}
